public class PrintNum {
    public static void main(String[] args) {
        Print(1234);
    }
    public static void Print(int n) {
        if (n < 10) {
            System.out.print(n+" ");
            return;
        }
        Print(n/10);
        System.out.print(n%10+" ");
    }
}